package java13;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.Socket;
import java.util.Scanner;

public class Client {
//201521123094
	public static void main(String[] args) {
//		String ip = null;
//		int num = 0;
//		Scanner sc = new Scanner(System.in);
//		ip = sc.next();
//		num = sc.nextInt();
		try {
//			Socket s = new Socket(ip, num);
			Socket s = new Socket("127.0.0.1", 8080);
			try {
				InputStream inStream = s.getInputStream();
				Scanner in = new Scanner(inStream);
				 OutputStream outStream = s.getOutputStream();
				 PrintWriter pw = new PrintWriter(outStream);
				 pw.println("abc");
				 pw.flush();
				while (in.hasNextLine()) {
					String line = in.nextLine();
					System.out.println(line);
				}
			} finally {
				s.close();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}